/*    */ package com.yss.sofa.cml.print;
/*    */ 
/*    */ import java.util.ArrayList;
/*    */ import java.util.Iterator;
/*    */ import java.util.List;
/*    */ 
/*    */ public class PrintLayer
/*    */ {
/*    */   private List<PrintElement> elements;
/*    */   private boolean iterated;
/*    */   private int zIndex;
/*    */ 
/*    */   public PrintLayer(int zIndex)
/*    */   {
/* 14 */     this.zIndex = zIndex;
/*    */   }
/*    */ 
/*    */   public Iterator<PrintElement> iterateElements()
/*    */   {
/* 22 */     if (this.iterated) {
/* 23 */       throw new IllegalStateException("Elements already iterated");
/*    */     }
/*    */ 
/* 26 */     this.iterated = true;
/* 27 */     if (this.elements == null) {
/* 28 */       synchronized (this) {
/* 29 */         this.elements = new ArrayList();
/*    */       }
/*    */     }
/* 32 */     return this.elements.iterator();
/*    */   }
/*    */ 
/*    */   public List<PrintElement> getElements() {
/* 36 */     if (this.elements == null) {
/* 37 */       synchronized (this) {
/* 38 */         this.elements = new ArrayList();
/*    */       }
/*    */     }
/* 41 */     return this.elements;
/*    */   }
/*    */ 
/*    */   public void addElement(PrintElement element) {
/* 45 */     if (this.elements == null) {
/* 46 */       synchronized (this) {
/* 47 */         this.elements = new ArrayList();
/*    */       }
/*    */     }
/* 50 */     this.elements.add(element);
/*    */   }
/*    */ 
/*    */   public void addElements(List<PrintElement> elements) {
/* 54 */     if (elements == null) {
/* 55 */       return;
/*    */     }
/* 57 */     if (this.elements == null) {
/* 58 */       synchronized (this) {
/* 59 */         this.elements = new ArrayList();
/*    */       }
/*    */     }
/* 62 */     this.elements.addAll(elements);
/*    */   }
/*    */ 
/*    */   public int getIndex() {
/* 66 */     return this.zIndex;
/*    */   }
/*    */ 
/*    */   public void setIndex(int zIndex) {
/* 70 */     this.zIndex = zIndex;
/*    */   }
/*    */ }

/* Location:           X:\repository\com\yss\sofa\cml\cml-api\1.1.0\cml-api-1.1.0.jar
 * Qualified Name:     com.yss.sofa.cml.print.PrintLayer
 * JD-Core Version:    0.6.0
 */